import numpy as np
a_list =[3,5,7]
a_mat= np.matrix(a_list)
print(a_mat)
a1=a_mat.T
print('a1=',a1)
a2=a_mat.shape
print('a2=',a2)
a3=a_mat.size
print('a3=',a3)

b_mat=np.matrix((1,2,3))
print(b_mat)
a4=a_mat*b_mat.T
print('a4=',a4)
a5=a_mat.mean()
print('a5=',a5)
a6=a_mat.sum()
print('a6=',a6)
a7=a_mat.max()
print('a7=',a7)
a8=a_mat.max(axis=1)
print('a8=',a8)
a9=a_mat.max(axis=0)
print('a9=',a9)

c_mat=np.matrix([[1,5,3],[2,9,6]])
print(c_mat)
a10=c_mat.argsort(axis=0)
print('a10=',a10)
a11=c_mat.argsort(axis=1)
print('a11=',a11)

d_mat=np.matrix([[1,2,3],[4,5,6],[7,8,9]])
a12=d_mat.diagonal()
print('a12=',a12)
a13=d_mat.flatten()
print('a13=',a13)
a14=np.linalg.eig([[1,1],[2,2]])
print('a14=',a14)
a15=np.cov([1,1,1,1,1])
print('a15=',a15)
x=[-2.1,-1,4.3]
y=[3,1.1,0.12]
X=np.vstack((x,y))
print(np.cov(X))
print(np.cov(x,y))
print(np.cov(x))
x=np.matrix([[1,2],[3,4]])
y=np.linalg.inv(x)
print('x*y=',x*y)
print('y*x=',y*x)
a16=np.corrcoef(x[0],x[1])
print('a16=',a16)
x=np.matrix(np.arange(0,10).reshape(2,5))
print('x=',x)
a17=x.sum()
print('a17=',a17)
a18=x.sum(axis=0)
print('a18=',a18)
a19=x.sum(axis=1)
print('a19=',a19)
a20=x.mean(axis=0)
print('a20=',a20)
a21=x.mean(axis=1)
print('a21=',a21)
weight=[0.3,0.7]
a22=np.average(x,axis=0,weights=weight)
print('a22=',a22)
a23=np.max(x)
print('a23=',a23)
a24=np.max(x,axis=0)
print('a24=',a24)

x=np.matrix(np.random.randint(0,10,size=(3,3)))
print('x=',x)
a25=np.std(x)
print('a25=',a25)
a26=x.std(axis=1)
print('a26=',a26)
a27=x.std(axis=0)
print('a27=',a27)
a28=x.var(axis=0)
print('a28=',a28)
x.sort(axis=0)
print('x=',x)
x.sort(axis=1)
print('x=',x)